﻿package {
	import flash.display.Sprite;
	import flash.display.GradientType;

	public class Sphere extends Sprite {
		
		public var radius:Number;
		public var color1, color2:uint;
		public var type:String=GradientType.RADIAL;
		//public var colors:Array;
		public var alphas:Array = [1, 1];
		public var ratios:Array = [0, 255];
		
		
		public function Sphere(radius:Number=40, color1:uint=0xff0000, color2:uint=0x000088) {
			this.radius = radius;
			this.color1 = color1;
			this.color2 = color2;
			init();
		}
		public function init():void {
			graphics.beginGradientFill(type, [color1, color2], alphas, ratios);
			graphics.drawCircle(0, 0, radius);
			graphics.endFill();
		}
		
	}
}